package com.wangxl.rabbitmqdemo.web;

import com.wangxl.rabbitmqdemo.conf.SimpleMQConfig;
import com.wangxl.rabbitmqdemo.producer.SimpleMessageSender;
import com.wangxl.rabbitmqdemo.util.ApplicationContextUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * @Author: wangxl
 * @Date: 2019/3/23 15:50
 */
@RestController
@RequestMapping("/demo")
@Slf4j
public class DemoController {

    @Autowired
    SimpleMessageSender sender;

    @RequestMapping("/test")
    public void test(){
        sender.sendSimpleMessage(UUID.randomUUID().toString());
        SimpleMQConfig simpleMQConfig = (SimpleMQConfig)ApplicationContextUtil.getBean("simpleMQConfig");
    }
}
